Skip to content

fix(memos-local-plugin): detect Hermes chat with global flags#1951

Merged
syzsunshine219 merged 4 commits into
MemTensor:dev-v2.0.22from
dashitongzhi:fix/memos-bridge-status-20260621090430
Jul 2, 2026
Merged

fix(memos-local-plugin): detect Hermes chat with global flags#1951
syzsunshine219 merged 4 commits into
MemTensor:dev-v2.0.22from
dashitongzhi:fix/memos-bridge-status-20260621090430

Conversation

@dashitongzhi

Copy link
Copy Markdown
Contributor

Summary

  • update bridge status detection to match Hermes chat processes when global flags appear before the chat subcommand
  • add a focused unit test covering standard chat, global flags before chat, and non-chat commands

Fixes #1915.

Verification

  • npm test -- --run tests/unit/bridge-status.test.ts
  • npm run lint

Copilot AI review requested due to automatic review settings June 21, 2026 01:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the memos-local-plugin bridge’s daemon-mode “Hermes chat running” detection to handle Hermes global CLI flags appearing before the chat subcommand, and adds a unit test to cover the expected matching cases.

Changes:

  • Replaced the pgrep -f "hermes chat" fixed-string match with a configurable pattern constant used by isHermesChatRunning().
  • Added a unit test covering: standard hermes chat, global flags before chat, and non-chat Hermes commands.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
apps/memos-local-plugin/bridge.cts Introduces a reusable process-match pattern and uses it for pgrep-based Hermes chat detection.
apps/memos-local-plugin/tests/unit/bridge-status.test.ts Adds a focused unit test validating Hermes chat process detection behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/memos-local-plugin/bridge.cts Outdated
};
}

const HERMES_CHAT_PROCESS_PATTERN = "hermes(?:\\s+\\S+)*\\s+chat\\b";
Comment on lines +12 to +14
const escapedPattern = match!.groups!.pattern;
const pattern = escapedPattern.replaceAll("\\\\", "\\");
return new RegExp(pattern).test(command);
@Memtensor-AI Memtensor-AI changed the base branch from main to dev-v2.0.22 July 1, 2026 13:15
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

AutoDev follow-up for closure audit:

  • Resolved the merge conflict with dev-v2.0.22 by keeping the current bridge/hermes-process.ts helper module and removing the stale inline bridge.cts implementation.
  • Updated the legacy tests/unit/bridge-status.test.ts to exercise matchesHermesChatCommandLine() from the helper module.
  • Cloud test-engine v2 rerun passed: tr-bb9781cd-1d4, scope memos_local_plugin/unit, 17/17 tests passed.

Conclusion: conflict resolved and cloud test passed. GitHub mergeability/checks are recalculating after the push; please wait for branch protection/review before merge.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

AutoDev follow-up update:

After dev-v2.0.22 advanced, I merged the latest base into this PR again and reran cloud test-engine v2.

  • Latest head: 536a62f
  • Cloud test-engine v2: tr-adb93484-b57
  • Scope: memos_local_plugin/unit
  • Result: PASSED, 17/17 tests passed

Conclusion: conflict remains resolved on latest dev-v2.0.22; cloud test passed. Remaining gate is normal GitHub branch protection / human review.

@syzsunshine219 syzsunshine219 merged commit eca8e46 into MemTensor:dev-v2.0.22 Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(memos-local-plugin): bridge status detection misses hermes chat with global flags

4 participants